package UIFree.controls
{
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import flash.geom.Rectangle;
	
	public class uif_stars extends uif_ecomponent {
		private var _starCount: int;
		public function uif_stars(parent:uif_component, a_starCount:int = 5, ax:int=0, ay:int=0, 
								  awidth:int=0, aheight:int=0, styleClass:Object='') {
			_starCount = a_starCount; 
			super(parent, ax, ay, awidth, aheight, styleClass);
		}
		
		override protected function paint(a_styleClass:String, a_method: String = ''):void {
			super.paint(a_styleClass);
			var r: Rectangle = getInner();
			var h2: Number = r.height / 2;
			var d: Number = r.width / _starCount; 
			for (var i: int=0; i<_starCount; i++) {
				begin2(style.star);
				drawStar(h2 * 0.55, h2, 5, d / 2 + i * d, h2);
				graphics.endFill();
			}
		}
		
		public function get count(): int {
			return _starCount;
		}
	}
}